v <- 1:30
plot(v, rep(1, length(v)), col=hsvScale(v), pch=19, cex=3)
## set the saturation to 0.5
plot(v, rep(1, length(v)), col=hsvScale(v, sat=0.5), pch=19, cex=3)
## cycle saturation values
plot(v, rep(1, length(v)), col=hsvScale(v, sat=c(0.3,0.6,0.9)), pch=19, cex=3)
## set the value to 0.4 (dark colours)
plot(v, rep(1, length(v)), col=hsvScale(v, val=0.5), pch=19, cex=3)
## the colours are not related to the position:
v2 <- sample(v, length(v))
plot(v, rep(1, length(v)), col=hsvScale(v2), pch=19, cex=3)
Run the code above in your browser using DataLab